//
//  ContentView.swift
//  SwiftUIText
//
//  Created by 李煜 on 2024/7/18.
//

import SwiftUI

struct ContentView: View {
    var body: some View {
        VStack {
            Text("Stay Hungry. Stay Foolish.")
                .fontWeight(.bold)
                // .font(.title)
                // 动态字体
                // .font(Font.system(.largeTitle, design: .rounded))
                // 固定大小字体
                .font(.system(size: 20))
                //.foregroundColor(.green)过时
                .foregroundStyle(.green)

            // 多行文字
            Text("Your time is limited, so don’t waste it living someone else’s life. Don’t be trapped by dogma—which is living with the results of other people’s thinking. Don’t let the noise of others’ opinions drown out your own inner voice. And most important, have the courage to follow your heart and intuition.")
                .fontWeight(.bold)
                .font(.title)
                .foregroundStyle(.gray) // 字体颜色
                .multilineTextAlignment(.center) // 文本对齐模式
                .lineLimit(3) // 限制行数
                .truncationMode(.head) // 截断模式
                .lineSpacing(20)//行间距
            
        }
        // 左右边距
//        .padding()
    }
}

#Preview {
    ContentView()
}
